package com.xnyzc.lhy.common.penum.driver.wallet;

public enum EDriverWalletRecordType {

    income(0, "余额", 0, "收入"),
    expenditure(1, "余额", 1, "支出"),
    weChatIncome(2, "微信", 0, "收入"),
    weChatExpenditure(3, "微信", 1, "支出"),
    alipayIncome(4, "支付宝", 0, "收入"),
    alipayExpenditure(5, "支付宝", 1, "支出"),
    withdraw(6, "提现", 2, "提现");

    private Integer value;

    private String desc;

    private Integer type;

    private String typeMsg;

    EDriverWalletRecordType(Integer value, String desc, Integer type, String typeMsg){
        this.value = value;
        this.desc = desc;
        this.type = type;
        this.typeMsg = typeMsg;
    }

    public static EDriverWalletRecordType findById(Integer value) {
        EDriverWalletRecordType eDriverWalletRecordType;
        switch (value) {
            case 0:
                eDriverWalletRecordType = EDriverWalletRecordType.income;
                break;
            case 1:
                eDriverWalletRecordType = EDriverWalletRecordType.expenditure;
                break;
            case 2:
                eDriverWalletRecordType = EDriverWalletRecordType.weChatIncome;
                break;
            case 3:
                eDriverWalletRecordType = EDriverWalletRecordType.weChatExpenditure;
                break;
            case 4:
                eDriverWalletRecordType = EDriverWalletRecordType.alipayIncome;
                break;
            case 5:
                eDriverWalletRecordType = EDriverWalletRecordType.alipayExpenditure;
                break;
            case 6:
                eDriverWalletRecordType = EDriverWalletRecordType.withdraw;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eDriverWalletRecordType;
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }

    public Integer getType() {
        return this.type;
    }

    public String getTypeMsg() {
        return this.typeMsg;
    }
}
